package com.lupan.passwordbox.domain;

import com.lupan.passwordbox.common.validator.Beyond5;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.NumberFormat;

import javax.validation.constraints.NotEmpty;
import java.util.Date;


/**
 * 说明：
 *
 * @author lupan
 * @version 2017/8/15 15:28
 */
public class Person {

    @NotEmpty(message = "{message.notempty}")
    private String name;
    @Range(max = 120,min = 0)
    private Integer age;
    @Beyond5
    private Integer weight;
    @NumberFormat(pattern = "##.##")
    private double price;
//    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date birthday;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Integer getWeight() {
        return weight;
    }

    public void setWeight(Integer weight) {
        this.weight = weight;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
}
